home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / gfxobj.h < prev    next >
C/C++ Source or Header  |  1999-09-03  |  3KB  |  81 lines

  1. #ifndef GFX_OBJECT_MANAGER
  2. #define GFX_OBJECT_MANAGER
  3. /*
  4.     gfx object manager
  5. */
  6. /* dirty flag */
  7. #define GFXOBJ_DIRTY_ALL      0xff
  8. #define GFXOBJ_DIRTY_SX_SY    0xff
  9. #define GFXOBJ_DIRTY_SIZE     0xff
  10. #define GFXOBJ_DIRTY_PRIORITY 0xff
  11. #define GFXOBJ_DIRTY_CODE     0xff
  12. #define GFXOBJ_DIRTY_COLOR    0xff
  13. #define GFXOBJ_DIRTY_FLIP     0xff
  14.  
  15. /* sort(priority) flag */
  16. #define GFXOBJ_DONT_SORT          0x00
  17. #define GFXOBJ_DO_SORT            0x01
  18. #define GFXOBJ_SORT_OBJECT_BACK   0x02
  19. #define GFXOBJ_SORT_PRIORITY_BACK 0x04
  20.  
  21. #define GFXOBJ_SORT_DEFAULT GFXOBJ_DO_SORT
  22.  
  23. /* one of object */
  24. struct gfx_object {
  25.     int        transparency;        /* transparency of gfx */
  26.     int        transparet_color;    /* transparet color of gfx */
  27.     struct    GfxElement *gfx;    /* source gfx , if gfx==0 then not calcrate sx,sy,visible,clip */
  28.     int        code;                /* code of gfx */
  29.     int        color;                /* color of gfx */
  30.     int        priority;            /* priority 0=lower */
  31.     int        sx;                    /* x position */
  32.     int        sy;                    /* y position */
  33.     int        flipx;                /* x flip */
  34.     int        flipy;                /* y flip */
  35.     /* source window in gfx tile : only non zooming gfx */
  36.     /* if use zooming gfx , top,left should be set 0, */
  37.     /* and width,height should be set same as gfx element */
  38.     int        top;                    /* x offset of source data */
  39.     int        left;                    /* y offset of source data */
  40.     int        width;                /* x size */
  41.     int        height;                /* y size */
  42.     int        palette_flag;        /* !! not supported !! , palette usage flag tracking */
  43.     /* zooming */
  44.     int scalex;                    /* zommscale , if 0 then non zooming gfx */
  45.     int scaley;                    /* */
  46.     /* link */
  47.     struct gfx_object *next;    /* next object point */
  48.     /* exrernal draw handler , (for tilemap,special sprite,etc) */
  49.     void    (*special_handler)(struct osd_bitmap *bitmap,struct gfx_object *object);
  50.                                 /* !!! not suppored yet !!! */
  51.     int        dirty_flag;            /* dirty flag */
  52.     /* !! only drawing routine !! */
  53.     int        visible;        /* visible flag        */
  54.     int        draw_x;            /* x adjusted position */
  55.     int        draw_y;            /* y adjusted position */
  56.     struct rectangle clip; /* clipping object size with visible area */
  57. };
  58.  
  59. /* object list */
  60. struct gfx_object_list {
  61.     int nums;                        /* read only */
  62.     int max_priority;                /* read only */
  63.     struct gfx_object *objects;
  64.                                     /* priority : objects[0]=lower       */
  65.                                     /*          : objects[nums-1]=higher */
  66.     struct gfx_object *first_object; /* pointer of first(lower) link object */
  67.     /* !! private area !! */
  68.     int sort_type;                    /* priority order type */
  69.     struct gfx_object_list *next;    /* resource tracking */
  70. };
  71.  
  72. void gfxobj_init(void);        /* called by core - don't call this in drivers */
  73. void gfxobj_close(void);    /* called by core - don't call this in drivers */
  74.  
  75. void gfxobj_mark_all_pixels_dirty(struct gfx_object_list *object_list);
  76. struct gfx_object_list *gfxobj_create(int nums,int max_priority,const struct gfx_object *def_object);
  77. void gfxobj_update(void);
  78. void gfxobj_draw(struct gfx_object_list *object_list);
  79.  
  80. #endif
  81.